#include <algorithm>
#include <vector>

using namespace std;

class Solution {
private:
    void quick_sort(vector<int>& nums, int left, int right) {
        if (left >= right) {
            return;
        }
        int base = nums[left];
        int i = left;
        int j = right;
        while (i < j) {
            while (i < j && nums[j] >= base) {
                j--;
            }
            while (i < j && nums[i] <= base) {
                i++;
            }
            if (i < j) {
                swap(nums[i], nums[j]);
            }
        }
        swap(nums[i], nums[left]);
        quick_sort(nums, left, i - 1);
        quick_sort(nums, i + 1, right);
    }
public:
    vector<int> sortArray(vector<int>& nums) {
        sort(nums.begin(), nums.end());
        //quick_sort(nums, 0, nums.size() - 1);
        return vector<int>(nums.begin(), nums.end());
    }
};